//2009/08/26 17:27:51
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class TrophyShelf
{
public:
    vector <int> countVisible(vector <int> trophies)
    {
        int tall = 0;
        int left = 0;
        int right = 0;
        for (int i=0; i<trophies.size(); i++)
            if (trophies[i] > tall)
            {
                left++;
                tall = trophies[i];
            }
        tall = 0;
        for (int i=trophies.size()-1; i>=0; i--)
            if (trophies[i] > tall)
            {
                right++;
                tall = trophies[i];
            }
        vector<int> v;
        v.push_back(left);
        v.push_back(right);
        return v;
    }
};
